package server

import (
	"context"

	"admin_template/bff/admin/internal/base/data"
	"admin_template/bff/admin/internal/router"

	"gitee.com/byx_darwin/go-tools/hertz"
	httpServer "github.com/cloudwego/hertz/pkg/app/server"
)

func NewHTTPServer(r *router.Router, data *data.Data) *httpServer.Hertz {
	hertzServer, _ := hertz.NewHTTPServer(context.Background(), &data.Config.ServerOption, data.CtxLogger)
	//初始化路由
	r.InitRouter(hertzServer)
	return hertzServer
}
